function extend(ChildClass, ParentClass) {
    ChildClass.prototype = new ParentClass();
    ChildClass.prototype.constructor = ChildClass;
}
/* base class */
var BaseClass = function() {
    this.name = "I'm BaseClass";
    this.lvl = 0;
};
BaseClass.prototype = {
    getName:function() {
        return this.name;
    },
    setName:function(str) {
        this.name = str;
    },
    getLVL:function(){
        return this.lvl;
    },
    setLevel:function(value){
        this.lvl = value;
    }
};
/* sub class 1 */
var SubClass1 = function() {
    this.setName("I'm SubClass1");
    this.setLevel(10);
}
/* sub class 2 */
var SubClass2 = function() {
    this.setName("I'm SubClass2");
}
extend(SubClass1, BaseClass);
extend(SubClass2, BaseClass);
var base = new BaseClass();
var sub1 = new SubClass1();
var sub2 = new SubClass2();
alert(base.getName());
alert(sub1.getLVL());
alert(sub2.getName());